#include "tim.h"

#ifndef __PWM_TIM_H__
#define __PWM_TIM_H__
struct pwm_str
{
	uint16_t pwm_U;
	uint16_t pwm_V;
	uint16_t pwm_W;
	uint16_t pwm_MAX;
	uint16_t pwm_MIN;
	uint16_t pwm_inc;
	uint8_t old_step,new_step;
	uint16_t time;
	uint16_t count;
	float angle;
	
};

void tim1_int(void);
void pwm_start(void);
void set_pwm_v(uint16_t value);
void  get_hall_ini_angle(void);
struct pwm_str *get_cur_hall_angle(void);
uint32_t *get_adv1(void);
void clear_adv1(void);
inline void clear_speed_count(void);
inline void add_speed_count_hall(int16_t v);
inline void add_speed_count_ab(int16_t v);
inline int16_t get_speed_value_ab(void);
inline int16_t get_speed_value_hall(void);	
void sys_stick_conclude(void);
int16_t get_current_speed_ab(void);
void set_fangxiang(uint16_t p);
uint16_t get_fangxiang(void);
int16_t get_hall_dir(uint16_t old_s,uint16_t new_s);
uint32_t get_sys_tk(void);
<<<<<<< HEAD
uint8_t *get_hall_str(void);
void reset_test(void);
uint8_t *get_motor_can(void);
void write_canshu_flash(void);
=======
>>>>>>> ffc76d3ef666ce94e9c47b20aad2f3dfa9ef8f44
#endif


